# 写一个装饰器来计算函数执行时间
import time


def docorator_time(func):
    def wrapper(*args, **kwargs):
        start_time = time.time()
        func(*args, **kwargs)
        end_time = time.time()
        print(f'函数{func.__name__}执行时间是：{end_time - start_time}')
    return  wrapper

@docorator_time
def add_num(a, b):
    result = a + b
    print(f'{a} + {b} = {result}')
    time.sleep(5)

if __name__ == '__main__':
    add_num(1, 2)